var AgendaSelection = function(){

}


var AgendaTalk = function(title, abstract, author, room){
	this.title 		= title;
	this.abstract 	= abstract;
	this.author		= author;
	this.room 		= room;
}

updateTalkTemplate = function(slotId){
	

	var talks = agendaFriday.slots[slotId];
	console.log("talktemplate");
	console.log(talks);
	$("#selectTalkContainer").empty();
	template = $( "#selectTalkTemplate").tmpl(talks);
	$("#selectTalkContainer").append(template);
}

addToMyAgenda = function(talkId,slotId){
	agendaFriday.slots[slotId]= talkId;
	agendaFriday.slots[slotId].selected= true;
	console.log("Added talk "+talkId+" To my agenda"+slotId);
	updateTemplateAgendaDay();
}


updateTalkDetailsTemplate = function(talkId,slotId){
	
	var talks = agendaFriday.slots[slotId].talks;
	var talk = talks[talkId];
	console.log(talk);
	console.log("talktemplate");
	console.log(talks);
	$("#talkDetailsContainer").empty();
	template = $( "#talkDetailsTemplate").tmpl(talk);
	$("#talkDetailsContainer").append(template);
}

updateTemplateAgendaDay = function (){

	var slots = agendaFriday;
	$("#academyGridContainer").empty();
	template = $( "#selectSlotTemplate").tmpl(slots);
	$("#academyGridContainer").append(template);

}


var AgendaDay = function(location){
	//this.slots 		= new Array();
	this.location 	= location;

}


AgendaDay.prototype.selectSlotOnOverview = function(slotId){
	console.log(slotId);
	this.selectedSlotId = slotId;
	this.selectedSlot = this.slots[slotId];
	updateTalkTemplate(slotId);
}


AgendaDay.prototype.printSlots = function (){
	console.log('print slots');
	for (var i = 0; i < this.slots.length; i++){
		//this.slots[i].printSlot();
		console.log(this.slots[i]);
	}
}






